home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.0 / Video Toaster v4.0.iso / arexx / editor / timelapse.rexx < prev   
OS/2 REXX Batch file  |  1995-03-11  |  2KB  |  89 lines

  1. /* TimeLapse.rexx -- Record frames at intervals of 1 to 60 mins */
  2. /* By Arnie Cachelin © 1992 NewTek Inc. */
  3. /* 4.0'ised by Bob Caron                */
  4.  
  5. OPTIONS RESULTS
  6. TOASTERLIB="ToasterARexx.port"
  7. REXXLIB = "rexxsupport.library"
  8. call addlib('PROJECT_REXX_PORT' , 0)
  9. call ADDLIB(TOASTERLIB , 0)
  10.  
  11. call set_view(2)
  12. if req_tell("TimeLapse 2.0") = 0 then call quit
  13.  
  14. rx startfilereq("Save Frames Where?","Toaster:Images","TimeLapse.Rgb")
  15.  
  16. exit=1
  17. do while exit=1
  18.   name=queryfilereq()
  19.   if name=0 then call quit
  20.   if name~="" then exit=0
  21.   address command "c:wait 1"
  22.   say name
  23. end
  24.  
  25. delay=0
  26. do while(delay<1)
  27.    delay=req_number("Delay In Minutes",'01')
  28.    if delay="Delay In Minutes" then call quit
  29.    end
  30.  
  31. tdelay=delay
  32.  
  33. count=0
  34. do while(count<1)
  35.    count=req_number("Number Of Frames To Grab",100)
  36.    if count="Number Of Frames To Grab" then call quit
  37.    end
  38.  
  39. input=req_number("Input To Grab From 1-4",1)
  40. if input="Input To Grab From 1-4" then call quit
  41. if input>4 then input=4
  42.  
  43. if req_tell("Still want to continue?")=0 then call quit
  44.  
  45. inputp="P00"||input
  46. inputm="M00"||input
  47.  
  48. if delay="" then delay = 1
  49. if delay<1 then delay = 1
  50. if delay>60 then delay = 60
  51. if count="" then count=10
  52. if count>1000 then count=1000
  53. if name="" then name=left(date(),6)
  54. delay=delay*60
  55.  
  56.  
  57. Switcher(TOSW)        /* Go to Switcher screen */
  58. Switcher(inputp)
  59. Switcher(inputm)
  60. Switcher(LVID)        /* Set to live digital video */
  61. do f=0 to count
  62.   Switcher(FVID)      /* Freeze frame */
  63.   fname =strip(name)||"."||right(f,3,'0')
  64.   SaveNextFrame(fname)
  65.   Switcher(LVID)      /* Set to live digital video */
  66.   call req_open("Timelapse 2.0","Current Frame ("||right(f,3,'0')||")","Current Delay ("||tdelay||")")
  67.   address command "C:Wait "||delay
  68.   call req_close()
  69. end
  70. call req_tell("All done!")
  71. call remlib('ToasterARexx.port')
  72. call remlib('PROJECT_REXX_PORT')
  73.  
  74. exit
  75.  
  76. SaveNextFrame:  Procedure
  77.   arg name
  78.   t=switcher(SRGB,name,4,0)
  79.   return t
  80.  
  81. quit:
  82.    call req_tell("Canceled!")
  83.    call remlib('ToasterARexx.port')
  84.    call remlib('PROJECT_REXX_PORT')
  85.    exit
  86.  
  87. /* A big thanks to Mojo! (Siyakubongela!) */
  88.  
  89.